package behavior.state;

public class DataSyncState extends AbsStartState{

    @Override
    public void dispatch() {
        System.out.println("进行数据同步");
        boolean success = Math.random() > 0.5;
        if(success) super.context.setState(StateFactory.SUCCESS);
        else super.context.setState(StateFactory.FAIL);
    }

    @Override
    public boolean isTerminalState() {
        return false;
    }
}
